//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Diagram
{
    internal class StyleLabel : IOfficeXmlSerializable
    {
        internal const string xmlName = "styleLbl";
        private OfficeArtExtensionList extLst;
        private string name;
        private Scene3D scene3d;
        private Shape3D sp3d;
        private ShapeStyle style;
        private TextProperties txPr;

        #region IOfficeXmlSerializable Members

        public void ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read(xmlName))
            {
                name = c.GetString("name");
                scene3d = c.ReadElement<Scene3D>();
                sp3d = c.ReadOptionalElement<Shape3D>("sp3d");
                txPr = c.ReadOptionalElement<TextProperties>("txPr");
                style = c.ReadOptionalElement<ShapeStyle>("style");
                extLst = c.ReadOptionalElement<OfficeArtExtensionList>("extLst");
            }
        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write(xmlName))
            {
                c.SetString("name", name );
                c.WriteElement(scene3d );
                c.WriteOptionalElement(sp3d );
                c.WriteOptionalElement(txPr );
                c.WriteOptionalElement(style );
                c.WriteOptionalElement(extLst );
            }
        }

        #endregion
    }
}